public class Task {

  String name
  String description
  Date createDate
  User user
  Priority priority

  static hasOne = [user: User, priority: Priority]

  static mapping = {
      version false
  }
  
  static def constraints = {
    id(blank: false, unique: true)
    name(size: 1..50, blank: false)
    user(blank: false)
    priority(blank: false)
    createDate(min:new Date(),max: new Date() + 1)
  }
}